%% calculatePhase
% 
% function to caclulate the phase of impedences 
%
%% Synatax
% [Phase] = calculatePhase(PressurePhase, FlowPhase)
%
%
%
%% Description
%  This function will caclulate and the impedence phase for 
% fourier pressure and flow harmonics that are imputed into the script.
% 
% ImpedencePhase = Flow(z) - Pressure(z)
%

%% Arguments
%* PressurePhase                       - Double: A nx1 double of the
%                                         Pressure Phase values
%
%* FlowPhase                           - Double: A nx1 double of Flow Phase values
%
%
%
%% Returns
%
%* Phase                              - Double: A nx1 double of impedence Phase  
%
%% Function Side Effects
%* N/A
%
%% Exceptions
%* An error is thrown if data type of input varaibles is not compatible
%  with what the function is expecting
%
%% See Also
% N/A
function [outputs] = calculatePhase(PressurePhase, FlowPhase)

if isa(PressurePhase, 'double') ~=1
    type = class(PressurePhase);
    error(sprintf(('Pressure Data is of type %s please change to type double'), type))    
end

if isa(FlowPhase, 'double') ~=1
    type = class(FlowPhase);
    error(sprintf(('Flow Data is of type %s please change to type double'), type))
end

outputs = FlowPhase - PressurePhase; % Phase of Flow - Phase of Pressure


end

